using System;
using System.Web.UI;

namespace SharpPieces.DemoApp
{

    /// <summary>
    /// The LiveGrid Skinning page.
    /// </summary>
    public partial class LiveGridSkinning : Page
    {

        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Load"/> event.
        /// </summary>
        /// <param name="e">The <see cref="T:System.EventArgs"/> object that contains the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            //this.Master.AddCodePreview(this.Page.MapPath("~/Code/ThemesDataProvider.cs"));

            switch (this.DropDownList1.SelectedValue)
            {
                case "default":
                    {
                        //this.Master.AddCodePreview(this.Page.MapPath(
                        //    string.Format("~/App_Themes/{0}/livegrid/grid-default.css", this.Theme)));
                        break;
                    }
                case "whiteblue":
                    {
                        //this.Master.AddCodePreview(this.Page.MapPath(
                        //    string.Format("~/App_Themes/{0}/livegrid/grid-whiteblue.css", this.Theme)));
                        break;
                    }
                case "black":
                    {
                        //this.Master.AddCodePreview(this.Page.MapPath(
                        //    string.Format("~/App_Themes/{0}/livegrid/grid-black.css", this.Theme)));
                        break;
                    }
                case "light":
                    {
                        //this.Master.AddCodePreview(this.Page.MapPath(
                        //    string.Format("~/App_Themes/{0}/livegrid/grid-light.css", this.Theme)));
                        break;
                    }
            }
        }

        /// <summary>
        /// Handles the SelectedIndexChanged event of the DropDownList1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.Div1.Attributes["class"] = this.DropDownList1.SelectedValue;
        }

    }

}
